<?php
    $db_host = "localhost";
    $db_user = "root";
    $db_pass = "lp001123";
    $db_name = "lxy";

    // 尝试连接数据库
    $conn = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
    mysqli_query($conn, "set names utf8");

    // 检测连接
    if (mysqli_connect_errno()) {
        die("数据库连接失败: " . mysqli_connect_error());
    }
?>
